package com.ds.lens.collector.receive.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @author WeiShaoying
 * @author ethan
 */
@Component
public class KafkaProducer {

    @Autowired
    private final KafkaTemplate kafkaTemplate;


    public KafkaProducer(KafkaTemplate kafkaTemplate) {
        this.kafkaTemplate = kafkaTemplate;

    }

    public void sendMessage(String topic, String metrics) {
        kafkaTemplate.send(topic, metrics);
    }
}
